﻿using System;
using SharpSqlAnalyzer.nodes;
using SharpSqlAnalyzer.pp.processor.type.comm;
using SharpSqlAnalyzer.pp.utils;
using SharpSqlAnalyzer.stmt;

namespace SharpSqlAnalyzer.pp.processor.type.plsql
{
	// Token: 0x02000237 RID: 567
	public class CreateFuncRightBEProcessor : AbstractProcessor
	{
		// Token: 0x060012DB RID: 4827 RVA: 0x0031B1B0 File Offset: 0x003193B0
		public override void process(TParseTreeNode nodeArg)
		{
			TStoredProcedureSqlStatement tstoredProcedureSqlStatement = nodeArg as TStoredProcedureSqlStatement;
			bool parameter = this.getParameter<bool>(typeof(bool));
			int parameter2 = this.getParameter<int>(typeof(int), 1);
			if (!parameter)
			{
				return;
			}
			if (tstoredProcedureSqlStatement.ParameterDeclarations == null)
			{
				return;
			}
			int length = SourceTokenOperator.curIndentLenVT(tstoredProcedureSqlStatement.startToken) + parameter2;
			TSourceToken tsourceToken = SourceTokenSearcher.forwardSearch(tstoredProcedureSqlStatement.ParameterDeclarations.endToken, 5, ")");
			if (tsourceToken == null)
			{
				return;
			}
			SourceTokenOperator.addBefore(this.Option, tsourceToken, SourceTokenOperator.createReturnSourceToken());
			SourceTokenOperator.addBefore(this.Option, tsourceToken, SourceTokenOperator.createWhitespaceSourceToken(length));
		}
	}
}
